def fn(a,n):
    sum=0
    temp=a
    for i in range(n):
        sum+=temp
        temp=temp*10+a
    return sum